<div ng-controller="exchangeRecordCtrl">
    <br>
    <br>
    <label class="control-label" for="textinput">状态:</label>
    <select ng-model="status" ng-options="c.status as c.name for c in statusSelect"><!--ng-change="getExchangeRecord(status)"-->
        <option value="">--请选择--</option>
    </select>
    <span class = "goods-search" style = "margin-left: 20px;">
        商品名称：<input type="text" id = "goods_search" ng-model="productName">
        联系姓名：<input type="text" id = "user_name" ng-model="userName">
        <a class="btn-primary btn-sm" ng-click="getExchangeRecordList(1)">搜索</a>
    </span>
    <br>

    <paging>
        <ul class="pagination" num-pages="tasks.pageCount" current-page="tasks.currentPage"
            on-select-page="selectPage(page)">
            <li ng-class="{disabled: noPrevious()}"><a ng-click="selectPrevious()">&laquo;</a>

            </li>
            <li ng-repeat="page in pages" ng-class="{active: isActive(page)}"><a
                    ng-click="selectPage(page)">{{page}}</a>

            </li>
            <li ng-class="{disabled: noNext()}"><a ng-click="selectNext()">&raquo;</a>

            </li>
            <li ng-show="currentPage>6"><a ng-click="selectPage(1)">首页</a>

            </li>
        </ul>
    </paging>

    <div class="tab-content">
        <div class="tab-pane active" id="tab_a">
            <table class="table table-condensed">
                <thead>
                <tr>
                    <th>商品名称</th>
                    <th>兑换数量</th>
                    <th>兑换价格</th>
                    <th>用户昵称</th>
                    <th>联系姓名</th>
                    <th>联系电话</th>
                    <th>联系地址</th>
                    <th>所属小区</th>
                    <th>订单状态</th>
                    <th>兑换时间</th>
                    <th>备注</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="temp in exchangeList">
                    <td>{{temp.productName}}</td>
                    <td>{{temp.exchangeNum}}</td>
                    <td>{{temp.productPrice}}</td>
                    <td>{{temp.nickName}}</td>
                    <td>{{temp.userName}}</td>
                    <td>{{temp.mobile}}</td>
                    <td>{{temp.address}}</td>
                    <td>{{temp.communityName}}</td>
                    <td>
                        <span ng-repeat="m in statusSelect">
                            <span ng-show="m.status == temp.status">{{m.name}}</span>
                        </span>
                    </td>
                    <td>{{temp.updateTime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{temp.remark}}</td>
                    <td>
                        <a ng-show="temp.status == 0" class="btn btn-default btn-xs"
                           ng-click="showModal(temp.id,2)">开始处理</a>
                        <a ng-show="temp.status == 0 || temp.status == 2" class="btn btn-secondary btn-xs"
                           ng-click="showModal(temp.id,1)">通过</a>
                        <a ng-show="temp.status == 0 || temp.status == 2" class="btn btn-danger btn-xs"
                           ng-click="showModal(temp.id,-1)">拒绝</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="modal fade" id="remark_model" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <label class="control-label" for="textinput">备注: </label>
                    <br><br>
                    <textarea id ="txtNumber" class="control-label" rows="3" ng-model="remark" required style="width:100%" placeholder="处理备注 ..." value=""></textarea>
                </div>
                <div class="modal-body">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button id="saveButton" type="submit"class="btn btn-default"
                            ng-click="examineProduct(remark)">保存
                    </button>
                </div>
            </div>
        </div>
    </div>


</div>